
class P10298_39643 {

	static String readLn() {
		String newLine = System.getProperty("line.separator");
		StringBuilder buffer = new StringBuilder();
		int car = -1;
		try {
			car = System.in.read();
			while ((car > 0) && (car != newLine.charAt(0))) {
				buffer.append((char) car);
				car = System.in.read();
			}
			if (car == newLine.charAt(0))
				System.in.skip(newLine.length() - 1);
		} catch (java.io.IOException e) {
			return (null);
		}
		if ((car < 0) && (buffer.length() == 0))
			return (null);
		return (buffer.toString());
	}
	
	public static void main(String[] args) {
		
		while (true) {
			String line = readLn();
			
			if (".".equals(line)) break;
			
			process(line);
			
		}
		
	}

	private static void process(String line) {
		String sub;
		
		for (int k = 1; k <= line.length(); k++) {
			if (line.length() % k != 0) continue;
			sub = line.substring(0, k);
			
			int x = line.length() / k;
			
			boolean found = true;
			
			for (int j = 0; j < x; j++) {
				if (!sub.equals(line.substring(j * k, j * k + k))) {
					found = false;
					continue;
				}
				
			}
			
			if (found) {
				System.out.println(x);
				return;
			}
		}
		
	}
	
}
